﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MobileIdeas.MobileTasks.SDK.DAL.DataAccess
{
    public class PermissionDAO : DataAccessObject
    {
        public List<Permission> GetUserPermissions(int userId)
        {
            using (var entities = this.EntityContext)
            {
                var query = from e in entities.userpermission.Include("Permission").Include("User")
                            where (e.user.userId == userId)
                            select e.permission;

                return query.ToList();
            }
        }
    }
}
